inserting data into Oracle tables

inserting data into Oracle tables

am 08.12.2005 11:31:40 von David Skyers

Is there a standard for inserting data into Oracle tables from a user =
input field in PHP?

Most Oracle tables will have a limit on the amount characters such as=20

Name VARCHAR2(60 BYTE) - this means the maximum amount of characters =
allowed is 60.

If you use special characters in PHP such as entering the following into =
a input box

!"=A3$%^&*()_+{}@~<>?|\,./;'#][=3D-=A6abcdefghijklmnopqrstuvwxyzA=20

When this gets passed to Oracle it takes the overall characters in the =
insert statement to 64, which then fails because it is over the Oracle =
table limit. Is there a standard way of dealing with something like =
this.

Regards,
David

----------------------------------
David Skyers
Support Analyst
Management Systems, UCL
d.skyers@ucl.ac.uk
020 7679 1849 (internal 41849)=20

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: inserting data into Oracle tables

am 08.12.2005 15:25:08 von Bastien Koert

check the length of your vairables before you insert...if its web based app,
then you should limit the input anyway and validate it that it matches the
desired data

Bastien


>From: "David Skyers"
>To: "php-db"
>Subject: [PHP-DB] inserting data into Oracle tables
>Date: Thu, 8 Dec 2005 10:31:40 -0000
>
>Is there a standard for inserting data into Oracle tables from a user input
>field in PHP?
>
>Most Oracle tables will have a limit on the amount characters such as
>
>Name VARCHAR2(60 BYTE) - this means the maximum amount of characters
>allowed is 60.
>
>If you use special characters in PHP such as entering the following into a
>input box
>
>¬!"£$%^&*()_+{}@~<>?|\,./;'#][=-¦abcdefghijklmnopqrstuvwxyzA
>
>When this gets passed to Oracle it takes the overall characters in the
>insert statement to 64, which then fails because it is over the Oracle
>table limit. Is there a standard way of dealing with something like this.
>
>Regards,
>David
>
>----------------------------------
>David Skyers
>Support Analyst
>Management Systems, UCL
>d.skyers@ucl.ac.uk
>020 7679 1849 (internal 41849)
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: inserting data into Oracle tables

am 08.12.2005 15:35:34 von roy.a.jones

--=_related 005028E1852570D1_=
Content-Type: multipart/alternative;
boundary="=_alternative 005028E2852570D1_="
Content-Transfer-Encoding: 7bit


--=_alternative 005028E2852570D1_=
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

You also need to consider your character set. VARCHAR2(60 BYTE) means it=20
only allows 60 bytes not 60 characters. Some character sets use multiple=20
bytes (2 or 3) for some characters. You could define your table as=20
VARCHAR2(60 CHAR) or set your nls=5Flength=5Fsemantics to CHAR.

I would also suggest that you setup a free account at=20
OracleTechnologyNetwork (OTN) ...=20
http://www.oracle.com/technology/index.html ... there is a lot of good=20
information there.


Roy A. Jones=20
US Pharma Database Administration=20
GlaxoSmithKline Inc. US Pharma IT, Data Warehousing Technology "Remember - =

is your friend!"=20



"Bastien Koert" =20
08-Dec-2005 09:25
=20
To
d.skyers@ucl.ac.uk, php-db@lists.php.net
cc

Subject
RE: [PHP-DB] inserting data into Oracle tables






check the length of your vairables before you insert...if its web based=20
app,=20
then you should limit the input anyway and validate it that it matches the =


desired data

Bastien


>From: "David Skyers"
>To: "php-db"
>Subject: [PHP-DB] inserting data into Oracle tables
>Date: Thu, 8 Dec 2005 10:31:40 -0000
>
>Is there a standard for inserting data into Oracle tables from a user=20
input=20
>field in PHP?
>
>Most Oracle tables will have a limit on the amount characters such as
>
>Name VARCHAR2(60 BYTE) - this means the maximum amount of characters=20
>allowed is 60.
>
>If you use special characters in PHP such as entering the following into=20
a=20
>input box
>
>!"=A3$%^&*()=5F+{}@~<>?|\,./;'#][=3D-=A6abcdefghijklmnopqrstuvwxyzA
>
>When this gets passed to Oracle it takes the overall characters in the=20
>insert statement to 64, which then fails because it is over the Oracle=20
>table limit. Is there a standard way of dealing with something like this.
>
>Regards,
>David
>
>----------------------------------
>David Skyers
>Support Analyst
>Management Systems, UCL
>d.skyers@ucl.ac.uk
>020 7679 1849 (internal 41849)
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--=20
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--=_alternative 005028E2852570D1_=
Content-Type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable



You also need to consider your character
set.  VARCHAR2(60 BYTE) means it only allows 60 bytes not 60 character=
s.
 Some character sets use multiple bytes (2 or 3) for some characters.
 You could define your table as VARCHAR2(60 CHAR) or set your nls=5Fle=
ngth=5Fsemantics
to CHAR.




I would also suggest that you setup a free
account at OracleTechnologyNetwork (OTN) ... http://www.oracle.com/technolo=
gy/index.html
.... there is a lot of good information there.





Roy A. Jones




US Pharma Database Administration=



GlaxoSmithKline Inc.
=3D#777777>US
Pharma IT, Data Warehousing Technology


"Remember - /tools/orasnap=5Fsite/> D1> 
is your friend!"









"Bastien Koert&q=
uot;
<bastien=5Fk@hotmail.com>

08-Dec-2005 09:25

      &nb=
sp;






To

d.skyers@ucl.ac.uk, php=
-db@lists.php.net


cc



Subject

RE: [PHP-DB] inserting =
data
into Oracle tables














check the length of your vairables before you insert=
....if
its web based app,

then you should limit the input anyway and validate it that it matches
the

desired data



Bastien





>From: "David Skyers" <d.skyers@ucl.ac.uk>

>To: "php-db" <php-db@lists.php.net>

>Subject: [PHP-DB] inserting data into Oracle tables

>Date: Thu, 8 Dec 2005 10:31:40 -0000

>

>Is there a standard for inserting data into Oracle tables from a user
input

>field in PHP?

>

>Most Oracle tables will have a limit on the amount characters such
as

>

>Name VARCHAR2(60 BYTE) - this means the maximum amount of characters


>allowed is 60.

>

>If you use special characters in PHP such as entering the following
into a

>input box

>

>!"=A3$%^&*()=5F+{}@~<>?|\,./;'#][=3D-=A6abcdefghijklm=
nopqrstuvwxyzA

>

>When this gets passed to Oracle it takes the overall characters in
the

>insert statement to 64, which then fails because it is over the Oracle


>table limit. Is there a standard way of dealing with something like
this.

>

>Regards,

>David

>

>----------------------------------

>David Skyers

>Support Analyst

>Management Systems, UCL

>d.skyers@ucl.ac.uk

>020 7679 1849 (internal 41849)

>

>--

>PHP Database Mailing List (http://www.php.net/)

>To unsubscribe, visit: http://www.php.net/unsub.php

>



--

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php








--=_alternative 005028E2852570D1_=--

--=_related 005028E1852570D1_=--